package com.allwees.bs.c.module.ops.repository;

import com.allwees.bs.c.module.base.repository.BaseRepository;
import com.allwees.bs.c.module.ops.entity.SubscribeEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SubscribeRepository extends BaseRepository<SubscribeEntity, Integer> {

    @Query("from SubscribeEntity where isDeleted=0 and subKey=:subKey and type = :type")
    SubscribeEntity findKey(@Param("subKey") String subKey,@Param("type") Integer type);

    List<SubscribeEntity> findAllByUserUuid(String userUuid);
}
